package com.searching.core.search;

import com.searching.core.dao.DataSourceFactory;
import com.searching.core.model.Condition;
import com.searching.core.model.Thing;

import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;

public class FileSearchImpl implements  FileSearch {
    //被final修饰的变量初始化方法：三种
    private final DataSource dataSource;

    public FileSearchImpl(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    @Override
    public List<Thing> search(Condition condition) {
        return this.search(condition);
        //数据库的处理逻辑
    }

//    public static void main(String[] args) {
//        FileSearch fileSearch = new FileSearchImpl(DataSourceFactory.dataSource());
//        List<Thing> list = fileSearch.search(new Condition());
//        System.out.println(list);
//
//    }
}
